//
//  CHSCharacterCountTextView.h
//  ChildHoodStemp
//
//  Created by 日东 罗 on 13-9-9.
//
//

#import <UIKit/UIKit.h>

@class CHSCharacterCountTextView;

@protocol CHSCharacterCountTextViewDelegate <NSObject>

@optional
-(void)characterCountTextView:(CHSCharacterCountTextView *)textView postedMessage:(NSString *)message;
- (void)characterCountTextViewDidBeginEditing:(CHSCharacterCountTextView *)textView;
//bug 8679 fixed by lixu
- (void)characterCountTextViewDidChanged:(CHSCharacterCountTextView*)textView;
@end

@interface CHSCharacterCountTextView : UIView <UITextViewDelegate>
{
    NSString *_text;
    
    UITextView *messageTextView;
	// The character counter
	UILabel *characterCountLabel;
	// The character count
    
	// Showing a placeholder
	BOOL showingPlaceholder;
	
	// The delegate
	__weak id <CHSCharacterCountTextViewDelegate> delegate;
}

CopyProperty NSString *text;
CopyProperty NSAttributedString *attrText;
StrongProperty UIFont *textFont;
CopyProperty NSString *placeHoldText;
AssignProperty NSInteger MAXCHARACTERCOUNT;

AssignProperty NSRange selectedRange;
WeakProperty id <CHSCharacterCountTextViewDelegate> delegate;
-(void)setEditEnable:(BOOL)isEditEnable;

- (BOOL)isFirstResponder;
- (BOOL)resignFirstResponder;

@end
